'use strict';
const unipay = require('unipay')
const {wxConfigMp} = require('config')
const unipayIns = unipay.initWeixin(wxConfigMp)

exports.main = async function (event,context) {
    let  orderInfo = await unipayIns.getOrderInfo({
        sub_openid: event.openid,
        openid: event.openid,
        body: event.body,
        outTradeNo: event.outTradeNo,
        totalFee:event.totalFee, // 金额，单位分
        notifyUrl: 'https://123.com' // 支付结果通知地址
    })
    return {
        orderInfo
    }
}
